<?php
namespace app\index\controller;
use think\Request;  
use think\controller\Rest; 
class News extends Rest{
	public function read($id){  
        $model = model('News');   
        $data=$model->where('id', $id)->find();// 查询单个数据  
        return json($data);  
    }
    public function readAll(){  
        $model = model('News');   
        $data=$model->select();
        return json($data);  
    }
}